var Member = require("../../../class/user/memberinfo.c");
module.exports = {
    prefix: "/user/member/",
    post: {
        "applyMember": {
            des: {
                name: "applyMember",
                content: "申请成为会员",
                params: [{
                    key: "realname",
                    type: "string"
                }, 
                {
                    key: "gender",
                    type: "string"
                }, 
                {
                    key: "idcard",
                    type: "string"
                },
                {
                	key: "job",
                    type: "string"
                },
                {
                	key:'type',
                	type:'int',
                	describe:'会员类型：1 、白金VIP，2、钻石VIP，3、至尊VIP'
                }]
            },
            method: function*(next) {
                var self = this;
                print("申请成为会员");
                try {
                	var data = yield new Member(self.session.user).save(self.request.body);
                   	self.body = data;
                } catch (e) {
                    self.body = printError(e);
                };
            }
        },
        "loginer": {
            des: {
                name: "getUserLoginer",
                content: "获取已登陆用户",
                params: []
            },
            method: function*() {
                var self = this;
            }
        },
        "loginout": {
            des: {
                name: "userLoginOut",
                content: "用户退出登陆"
            },
            method: function*(next) {
                print("用户退出登陆");
                var self = this;
                
            }
        }
    },
    get: {
        "info/:_id": {
            des: {
                name: "getUserInfo",
                content: "获取用户信息",
                params: [{
                    params: "_id",
                    type: "string"
                }]
            },
            method: function*() {
                var self = this;
                print("获取用户信息");
                try {
                    
                } catch (e) {
                    console.log(e);
                    self.body = printError(e);
                };
            }
        },
        'count':{
            des:{
                name:'getCount',
                content:'获取申请会员数量',
                params:[{
                    key:'status',
                    type:'int'
                }]
            },
            method: function*() {
                var self = this;
                try {
                    self.body = 1;
                } catch (e) {
                    console.log(e);
                    self.body = printError(e);
                };
            }
        }
    }
}
